package com.example.FileSearch;

import android.os.FileObserver;

/**
 * Created by fany on 14-1-22.
 */
class FileRecorderUpdater  extends FileObserver {
    public FileRecorderUpdater(String path, FileRecorder recorder){
        super(path);
        _recorder = recorder;
    }

    @Override
    public void onEvent(int event, String path) {
        switch (event){
            case  android.os.FileObserver.CREATE:{
                _recorder.Record(path);
                break;
            }
            case  android.os.FileObserver.DELETE:{
                _recorder.UnRecord(path);
                break;
            }
        }
    }

    private FileRecorder _recorder;
}
